<p-dialog [header]="'发起处罚'" (onHide)="submited=false;close();" [(visible)]="isShow" modal="modal" width="700" [responsive]="true">
    <div class="text-center wrap-content">
        <div class="inline-block" *ngIf="isShow">
            <form #form="ngForm" (ngSubmit)="form.form.valid" novalidate class="form-horizontal" role="form">
                <div class="table-row">
                    <div class="table-cell text-right p-l-25 p-required width-128">项目名称：</div>
                    <div class="table-cell text-left width-320">
                        {{objcetCodeAndName}}
                    </div>
                </div>
                <div class="table-row">
                    <div class="table-cell text-right p-l-25 width-128 p-required">责任人：</div>
                    <div class="table-cell text-left relative width-320">
                        <p-dropdown name="personLiable" #personLiable="ngModel" styleClass="width-220" [options]="personLiableOption" [(ngModel)]="personLiableSeleted"
                            placeholder="请选择责任人" dataKey="code" optionLabel="responsibilitierNameAndType" required></p-dropdown>
                        <p-message [severity]="'error'" styleClass="p-center" [text]="{'请选择责任人':personLiable.errors?.required&&(personLiable.touched || submited)}"></p-message>
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 width-128 p-required">处罚类型：</div>
                    <div class="table-cell text-left relative width-320">
                        <p-dropdown name="punishType" #punishType="ngModel" styleClass="width-220" [options]="punishTypeOption" [(ngModel)]="formObj.punishType"
                            [justValue]="true" placeholder="请选择处罚类型" dataKey="code" optionLabel="name" required></p-dropdown>
                        <p-message [severity]="'error'" styleClass="p-center" [text]="{'请选择处罚类型':punishType.errors?.required&&(punishType.touched || submited)}"></p-message>
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 width-128 p-required v-top1">罚款原因：</div>
                    <div class="table-cell text-left relative width-320">
                        <textarea rows="4" name='punishRemark' required (focus)="punishRemarkRight=false" (blur)="punishRemarkRight=true" cols="30"
                            maxlength="50" #punishRemark="ngModel" [(ngModel)]="formObj.punishReason" pInputTextarea placeholder="请输入罚款原因"
                            [ngStyle]="{'width': '220px' }"  [ngClass]="punishRemarkRight && (punishRemark.errors?.required&&(punishRemark.touched || submited))?'p-input-error':'p-input-error-none'"></textarea>
                        <p-message *ngIf="punishRemarkRight" styleClass="p-center1" [severity]="'error'" [text]="{'请输入罚款原因':punishRemark.errors?.required&&(punishRemark.touched || submited)}"></p-message>
                        <div class="text-right opacity06" style="padding-right: 98px;">还可输入{{50 - (formObj.punishReason?.length || 0)}}个字</div>
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 width-128 p-required">罚款金额：</div>
                    <div class="table-cell text-left relative width-320">
                        <input type="text" name="fine" (focus)="fineRight=false" (blur)="fineRight=true" #fine="ngModel" class="p-input width-220"
                            placeholder="请输入罚款金额" required pInputText numberType="decimal2" maxlength="8" [(ngModel)]="formObj.pubishAmout" [ngClass]="fineRight && (fine.errors?.required&&(fine.touched || submited))?'p-input-error':'p-input-error-none'">
                        <p-message *ngIf="fineRight" [severity]="'error'" styleClass="p-center" [text]="{'请输入罚款金额':fine.errors?.required&&(fine.touched || submited)}"></p-message>
                    </div>
                </div>


                <div class="table-row">
                    <div class="table-cell text-right p-l-25 width-128 v-top1">说明：</div>
                    <div class="table-cell text-left relative width-320">
                        <textarea rows="4" name='explain' (focus)="explainRight=false" (blur)="explainRight=true" cols="30" maxlength="50" #explain="ngModel"
                            [(ngModel)]="formObj.note" pInputTextarea placeholder="请输入罚款原因" [ngStyle]="{'width': '220px' }" [ngClass]="'p-input-error-none'"></textarea>
                        <div class="text-right opacity06" style="padding-right: 98px;">还可输入{{50 - (formObj.note?.length || 0)}}个字</div>
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 width-128"></div>
                    <div class="table-cell text-left">
                        <button pButton type="button" (click)="form.form.valid?savePunish():submited = true" [label]="'提交'" class="btn btn-success"></button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</p-dialog>